import Vue from 'vue'
import Router from 'vue-router'
import beforeEach from './beforeEach.js'
Vue.use(Router)

const Login = r => require.ensure([], () => r(require('../pages/login/index.vue')), 'Login')
// 主页
const Home = r => require.ensure([], () => r(require('../pages/home/index.vue')), 'Home')
// 呼叫中心
const CallCenterGuide = r => require.ensure([], () => r(require('../pages/call-center/index.vue')), 'CallCenter')
const CallCenter = r => require.ensure([], () => r(require('../pages/call-center/call-center.vue')), 'CallCenter')
const BackLog = r => require.ensure([], () => r(require('../pages/call-center/children/back-log/index.vue')), 'BackLog')
const Call = r => require.ensure([], () => r(require('../pages/call-center/children/call/index.vue')), 'Call')
const CallTotal = r => require.ensure([], () => r(require('../pages/call-center/children/call-total/index.vue')), 'CallTotal')
const CallDetail = r => require.ensure([], () => r(require('../pages/call-center/children/call-detail/index.vue')), 'CallDetail')
const ZJLists = r => require.ensure([], () => r(require('../pages/call-center/children/zj-lists/index.vue')), 'ZJLists')
const ZJReports = r => require.ensure([], () => r(require('../pages/call-center/children/zj-reports/index.vue')), 'ZJReports')
// const CallDetailBX = r => require.ensure([], () => r(require('../pages/call-center/children/call-detail/index.1.vue')), 'CallDetailBX')
// 数据报表
const DataChart = r => require.ensure([], () => r(require('../pages/data-chart/index.vue')), 'DataChart')
// const DataTrans = r => require.ensure([], () => r(require('../pages/data-quantity/trans.vue')), 'DataTrans')
const cesChart = r => require.ensure([], () => r(require('../pages/ces/index.vue')), 'cesChart')
const DataSucceed = r => require.ensure([], () => r(require('../pages/data-quantity/succeed.vue')), 'DataSucceed')
// 客服管理
const FbCustomer = r => require.ensure([], () => r(require('../pages/personnel-manage/children/fb-customer/index.vue')), 'FbCustomer')//新增客户分配
const PersonnelManage = r => require.ensure([], () => r(require('../pages/personnel-manage/index.vue')), 'PersonnelManage')
const OrdersManage = r => require.ensure([], () => r(require('../pages/personnel-manage/children/orders-manage/index.vue')), 'OrdersManage')
const CustomerMonitor = r => require.ensure([], () => r(require('../pages/personnel-manage/children/customer-monitor/index.vue')), 'CustomerMonitor')
const Banktest = r => require.ensure([], () => r(require('../pages/personnel-manage/children/bank-test/index.vue')), 'Banktest')//新增银行卡审核
const ScheduledTask = r => require.ensure([], () => r(require('../pages/personnel-manage/children/scheduled-task/index.vue')), 'ScheduledTask')
const UserSuggestion = r => require.ensure([], () => r(require('../pages/personnel-manage/children/user-suggestion')), 'UserSuggestion')
const TodayCount = r => require.ensure([], () => r(require('../pages/personnel-manage/children/today-count')), 'TodayCount')
const CheckCode = r => require.ensure([], () => r(require('../pages/personnel-manage/children/check-verifyCode')), 'CheckCode')
const MobileMsg = r => require.ensure([], () => r(require('../pages/personnel-manage/children/mobileMsg-management')), 'MobileMsg')
const AddMsg = r => require.ensure([], () => r(require('../pages/personnel-manage/children/mobileMsg-management/children/add-mobileMsg')), 'AddMsg')
const ManageKF = r => require.ensure([], () => r(require('../pages/personnel-manage/children/manage-onlineKF')), 'ManageKF')
// 操作日志
const CusMonHandler = r => require.ensure([], () => r(require('../pages/personnel-manage/children/customer-monitor/czrz.vue')), 'CusMonHandler')
//

// 会员中心
const VipManage = r => require.ensure([], () => r(require('../pages/vip-manage/index.vue')), 'VipManage')
const HuiKuan = r => require.ensure([], () => r(require('../pages/vip-manage/huikuan.vue')), 'huikuan')
const Daida = r => require.ensure([], () => r(require('../pages/vip-manage/daida.vue')), 'daida')
const VipManageDetail = r => require.ensure([], () => r(require('../pages/vip-manage/detail.vue')), 'VipManageDetail')
// 基本信息
const Table1 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table1.vue')), 'Table1')
// 资金记录
const Table2 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table2.vue')), 'Table2')
// 联系记录
const Table3 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table3.vue')), 'Table3')
// 红包记录
const Table4 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table4.vue')), 'Table4')
// 财币记录
const Table5 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table5.vue')), 'Table5')
// 投标记录
const Table6 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table6.vue')), 'Table6')
// 投标汇总
const Table7 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table7.vue')), 'Table7')
// 体验金记录
const Table8 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table8.vue')), 'Table8')
// 商品兑换记录
const Table9 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table9.vue')), 'Table9')
// 奖励选择查询
const Table10 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table10.vue')), 'Table10')
// 奖励记录查询
const Table11 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table11.vue')), 'Table11')
// 充值记录
const Table12 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table12.vue')), 'Table12')
// 积分记录
const Table13 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table13.vue')), 'Table13')
// 银行流水
const Table14 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table14.vue')), 'Table14')
// 复投加息页面
const Table15 = r => require.ensure([], () => r(require('../pages/vip-manage/components/table15.vue')), 'Table15')
// 红包页面
const Tablehb = r => require.ensure([], () => r(require('../pages/vip-manage/components/t_hongbao.vue')), 'Tablehb')
// 现金券页面
const Tablexjq = r => require.ensure([], () => r(require('../pages/vip-manage/components/t_xianjinquan.vue')), 'Tablexjq')
// 加息券页面
const Tablejxq = r => require.ensure([], () => r(require('../pages/vip-manage/components/t_jxq.vue')), 'Tablejxq')
// VIP等级成长值
const Tablevipcz = r => require.ensure([], () => r(require('../pages/vip-manage/components/t_vipCZ.vue')), 'Tablevipcz')
// 会员日志
const Tablehyrz = r => require.ensure([], () => r(require('../pages/vip-manage/components/t_hyrz.vue')), 'Tablehyrz')

// 展期资金
const Zhanqi = r => require.ensure([], () => r(require('../pages/vip-manage/zhanqi.vue')), 'Zhanqi')

// const NS_HOME = NS.HOME
// const NS_PERSONAL = NS.PERSONAL
let isAdmin = true
let router = new Router({
  routes: [{
      // name: '主页',
      path: '/',
      component: Home,
      meta: {
        title: '主页',
        keepAlive: false,
      }
    },
    {
      name: '呼叫中心引导页',
      path: '/call-center',
      component: CallCenterGuide,
      meta: {
        title: '呼叫中心',
        keepAlive: true,
      },
      children: [{
        name: '呼叫中心',
        path: '/call-center',
        component: CallCenter,
        meta: {
          title: '呼叫中心',
          keepAlive: true,
        }
      },{
        name: '通话详情',
        path: 'call-detail',
        component: CallDetail,
        meta: {
          title: '通话详情',
          keepAlive: false,
        }
      },
      {
        name: '通话记录',
        path: '/call',
        component: Call,
        meta: {
          title: '通话记录',
          keepAlive: true,
        }
      },{
        name: '回访记录',
        path: '/back-log',
        component: BackLog,
        meta: {
          title: '回访记录',
          keepAlive: true,
        }
      },{
        name: '通话汇总',
        path: '/call-total',
        component: CallTotal,
        meta: {
          title: '通话汇总',
          keepAlive: true,
        }
      },{
        name: '质检列表',
        path: '/zj-lists',
        component: ZJLists,
        meta: {
          title: '质检列表',
          keepAlive: true,
        }
      },{
        name: '质检报表',
        path: '/zj-reports',
        component: ZJReports,
        meta: {
          title: '质检报表',
          keepAlive: false,
        }
      }]
    },
    {
      name: '成功的客户和自然率',
      path: '/data-chart',
      component: DataChart,
      meta: {
        title: '成功的客户和自然率',
        keepAlive: true,
      },
    },
    {
      name: '测试',
      path: '/ces',
      component: cesChart,
      meta: {
        title: '测试',
        keepAlive: true,
      },
    },
    {
      name: '成功人数列表',
      path: '/data-succeed/:type/:kfid/:dt',
      component: DataSucceed,
      meta: {
        title: '成功的客户和自然率',
        keepAlive: false,
      },
    },
    {
      path: '/personnal-manage',
      component: PersonnelManage,
      meta: {
        title: '客服管理',
        keepAlive: true,
      },
      children: [{
        name: '客服管理',
        path: '',
        component: OrdersManage,
        meta: {
          title: '排班管理',
          keepAlive: true,
        }
      },{
        name: '排班管理',
        path: 'orders-manage',
        component: OrdersManage,
        meta: {
          title: '排班管理',
          keepAlive: true,
        }
      }, {
        name: '客服监控',
        path: 'customer-monitor',
        component: CustomerMonitor,
        meta: {
          title: '客服监控',
          keepAlive: true,
        }
      }, {
        name: '操作日志',
        path: 'cusMon-log',
        component: CusMonHandler,
        meta: {
          title: '操作日志',
          keepAlive: true,
        }
      }
      ,{
        name: '客户分配',
        path: 'fb-customer',
        component: FbCustomer,
        meta: {
          title: '客户分配',
          keepAlive: true,
        }
      },
      {
        name:'银行卡信息',
        path:'bank-test',
        component:Banktest,
        meta:{
          title:'银行卡信息',
          keepAlive:true
        }
      },
      {
        name: '计划任务',
        path: 'scheduled-task',
        component: ScheduledTask,
        meta: {
          title: '计划任务',
          keepAlive: true,
        }
      }, {
        name: '用户建议',
        path: 'user-suggestion',
        component: UserSuggestion,
        meta: {
          title: '用户建议',
          keepAlive: true,
        }
      }, {
        name: '今日统计',
        path: 'today-count',
        component: TodayCount,
        meta: {
          title: '今日统计',
          keepAlive: false,
        }
      }, {
        name: '查询验证码',
        path: 'check-verifyCode',
        component: CheckCode,
        meta: {
          title: '查询验证码',
          keepAlive: false,
        }
      }, {
        name: '手机短信管理',
        path: 'mobileMsg-management',
        component: MobileMsg,
        meta: {
          title: '手机短信管理',
          keepAlive: false,
        }
      }, {
        name: '添加手机短信',
        path: 'mobileMsg-management/add',
        component: AddMsg,
        meta: {
          title: '添加手机短信',
          keepAlive: false,
        }
      },{
        name: '管理在线客服',
        path: 'manage-onlineKF',
        component: ManageKF,
        meta: {
          title: '管理在线客服',
          keepAlive: true,
        }
      }]
    },
    {
      name: '会员列表',
      path: '/vip-manage',
      component: VipManage,
      meta: {
        title: '会员列表',
        keepAlive: true,
      },
    },
    {
      name: '回款列表',
      path: '/huikuan',
      component: HuiKuan,
      meta: {
        title: '回款列表',
        keepAlive: true,
      },
    },
    {
      name: '任务待打列表',
      path: '/daida',
      component: Daida,
      meta: {
        title: '任务待打列表',
        keepAlive: false,
      },
    },
    {
      name: '展期资金',
      path: '/zhanqi',
      component: Zhanqi,
      meta: {
        title: '展期资金',
        keepAlive: true
      }
    },
    {
      name: '会员管理详情',
      path: '/vip-manage/detail/:id',
      component: VipManageDetail,
      meta: {
        title: '会员管理详情',
        keepAlive: false,
      },
      children: [{
          name: '基本信息',
          path: 'jbxx',
          // path: 'jbxx',
          component: Table1,
          meta: {
            title: '基本信息',
          },
        },
        {
          name: '资金记录',
          path: 'zjjl',
          component: Table2,
          meta: {
            title: '资金记录',
          },
        },
        {
          name: '联系记录',
          path: 'lxjl',
          component: Table3,
          meta: {
            title: '联系记录',
          },
        },
        {
          name: '红包记录',
          path: '红包记录',
          component: Table4,
          meta: {
            title: '红包记录',
          },
        },
        {
          name: '财币记录',
          path: '财币记录',
          component: Table5,
          meta: {
            title: '财币记录',
          },
        },
        {
          name: '投标记录',
          path: 'tbjl',
          component: Table6,
          meta: {
            title: '投标记录'
          },
        },
        {
          name: '投标汇总',
          path: 'tbhz',
          component: Table7,
          meta: {
            title: '投标汇总'
          },
        },
        {
          name: '体验金记录',
          path: 'tyjjl',
          component: Table8,
          meta: {
            title: '体验金记录'
          },
        },
        {
          name: '商品兑换记录',
          path: 'spdhjl',
          component: Table9,
          meta: {
            title: '商品兑换记录'
          },
        },
        {
          name: '奖励选择查询',
          path: 'jlxzcx',
          component: Table10,
          meta: {
            title: '奖励选择查询'
          },
        },
        {
          name: '奖励记录查询',
          path: 'jljlcx',
          component: Table11,
          meta: {
            title: '奖励记录查询'
          },
        },
        {
          name: '充值记录',
          path: 'czjl',
          component: Table12,
          meta: {
            title: '充值记录'
          },
        },
        {
          name: '积分记录',
          path: 'jfjl',
          component: Table13,
          meta: {
            title: '积分记录'
          },
        },
        {
          name: '银行流水',
          path: 'yhls',
          component: Table14,
          meta: {
            title: '银行流水'
          },
        },
        {
          name: '复投加息',
          path: 'ftjx',
          component: Table15,
          meta: {
            title: '复投加息'
          },
        },
        {
          name: '红包',
          path: 'hb',
          component: Tablehb,
          meta: {
            title: '红包'
          },
        },
        {
          name: '现金券',
          path: 'xjq',
          component: Tablexjq,
          meta: {
            title: '现金券'
          },
        },
        {
          name: '加息券',
          path: 'jxq',
          component: Tablejxq,
          meta: {
            title: '加息券'
          },
        },
        {
          name: 'VIP等级成长值',
          path: 'vip',
          component: Tablevipcz,
          meta: {
            title: 'VIP等级成长值'
          },
        },
        {
          name: '会员日志',
          path: 'viprz',
          component: Tablehyrz,
          meta: {
            title: '会员日志'
          },
        },
      ]
    }
  ]
})
beforeEach(router)
export default router
